package rx.test;

import java.util.Date;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.LockMode;
import org.hibernate.Query;
import org.hibernate.criterion.Example;

/**
 * Data access object (DAO) for domain model class Columntest.
 * @see rx.test.Columntest
 * @author MyEclipse - Hibernate Tools
 */
public class ColumntestDAO extends BaseHibernateDAO {

    private static final Log log = LogFactory.getLog(ColumntestDAO.class);

	//property constants
	public static final String COLUMN2 = "column2";
	public static final String COLUMN3 = "column3";
	public static final String COLUMN4 = "column4";
	public static final String COLUMN5 = "column5";
	public static final String COLUMN6 = "column6";
	public static final String COLUMN7 = "column7";
	public static final String COLUMN8 = "column8";
	public static final String COLUMN9 = "column9";
	public static final String COLUMN10 = "column10";
	public static final String COLUMN25 = "column25";
	public static final String COLUMN26 = "column26";
	public static final String COLUMN11 = "column11";
	public static final String COLUMN14 = "column14";
	public static final String COLUMN15 = "column15";
	public static final String COLUMN16 = "column16";
	public static final String COLUMN17 = "column17";
	public static final String COLUMN18 = "column18";
	public static final String COLUMN19 = "column19";
	public static final String COLUMN20 = "column20";
	public static final String COLUMN21 = "column21";
	public static final String COLUMN22 = "column22";
	public static final String COLUMN23 = "column23";
	public static final String COLUMN27 = "column27";
	public static final String COLUMN28 = "column28";
	public static final String COLUMN29 = "column29";
	public static final String COLUMN30 = "column30";
	public static final String COLUMN31 = "column31";
	public static final String COLUMN32 = "column32";
	public static final String COLUMN33 = "column33";
	public static final String COLUMN34 = "column34";
	public static final String COLUMN35 = "column35";
	public static final String COLUMN36 = "column36";
	public static final String COLUMN37 = "column37";
	public static final String COLUMN38 = "column38";
	public static final String COLUMN39 = "column39";
	public static final String COLUMN40 = "column40";
	public static final String COLUMN41 = "column41";
	public static final String COLUMN42 = "column42";
	public static final String COLUMN43 = "column43";
	public static final String COLUMN44 = "column44";
	public static final String COLUMN45 = "column45";
	public static final String COLUMN47 = "column47";
	public static final String COLUMN48 = "column48";
	public static final String COLUMN49 = "column49";
	public static final String COLUMN53 = "column53";
	public static final String COLUMN54 = "column54";
	public static final String COLUMN55 = "column55";
	public static final String COLUMN56 = "column56";
	public static final String COLUMN57 = "column57";
	public static final String COLUMN58 = "column58";
	public static final String COLUMN59 = "column59";

    
    public void save(Columntest transientInstance) {
        log.debug("saving Columntest instance");
        try {
            getSession().save(transientInstance);
            log.debug("save successful");
        } catch (RuntimeException re) {
            log.error("save failed", re);
            throw re;
        }
    }
    
	public void delete(Columntest persistentInstance) {
        log.debug("deleting Columntest instance");
        try {
            getSession().delete(persistentInstance);
            log.debug("delete successful");
        } catch (RuntimeException re) {
            log.error("delete failed", re);
            throw re;
        }
    }
    
    public Columntest findById( java.lang.Long id) {
        log.debug("getting Columntest instance with id: " + id);
        try {
            Columntest instance = (Columntest) getSession()
                    .get("rx.test.Columntest", id);
            return instance;
        } catch (RuntimeException re) {
            log.error("get failed", re);
            throw re;
        }
    }
    
    
    public List findByExample(Columntest instance) {
        log.debug("finding Columntest instance by example");
        try {
            List results = getSession()
                    .createCriteria("rx.test.Columntest")
                    .add(Example.create(instance))
            .list();
            log.debug("find by example successful, result size: " + results.size());
            return results;
        } catch (RuntimeException re) {
            log.error("find by example failed", re);
            throw re;
        }
    }    
    
    public List findByProperty(String propertyName, Object value) {
      log.debug("finding Columntest instance with property: " + propertyName
            + ", value: " + value);
      try {
         String queryString = "from Columntest as model where model." 
         						+ propertyName + "= ?";
         Query queryObject = getSession().createQuery(queryString);
		 queryObject.setParameter(0, value);
		 return queryObject.list();
      } catch (RuntimeException re) {
         log.error("find by property name failed", re);
         throw re;
      }
	}

	public List findByColumn2(Object column2) {
		return findByProperty(COLUMN2, column2);
	}
	
	public List findByColumn3(Object column3) {
		return findByProperty(COLUMN3, column3);
	}
	
	public List findByColumn4(Object column4) {
		return findByProperty(COLUMN4, column4);
	}
	
	public List findByColumn5(Object column5) {
		return findByProperty(COLUMN5, column5);
	}
	
	public List findByColumn6(Object column6) {
		return findByProperty(COLUMN6, column6);
	}
	
	public List findByColumn7(Object column7) {
		return findByProperty(COLUMN7, column7);
	}
	
	public List findByColumn8(Object column8) {
		return findByProperty(COLUMN8, column8);
	}
	
	public List findByColumn9(Object column9) {
		return findByProperty(COLUMN9, column9);
	}
	
	public List findByColumn10(Object column10) {
		return findByProperty(COLUMN10, column10);
	}
	
	public List findByColumn25(Object column25) {
		return findByProperty(COLUMN25, column25);
	}
	
	public List findByColumn26(Object column26) {
		return findByProperty(COLUMN26, column26);
	}
	
	public List findByColumn11(Object column11) {
		return findByProperty(COLUMN11, column11);
	}
	
	public List findByColumn14(Object column14) {
		return findByProperty(COLUMN14, column14);
	}
	
	public List findByColumn15(Object column15) {
		return findByProperty(COLUMN15, column15);
	}
	
	public List findByColumn16(Object column16) {
		return findByProperty(COLUMN16, column16);
	}
	
	public List findByColumn17(Object column17) {
		return findByProperty(COLUMN17, column17);
	}
	
	public List findByColumn18(Object column18) {
		return findByProperty(COLUMN18, column18);
	}
	
	public List findByColumn19(Object column19) {
		return findByProperty(COLUMN19, column19);
	}
	
	public List findByColumn20(Object column20) {
		return findByProperty(COLUMN20, column20);
	}
	
	public List findByColumn21(Object column21) {
		return findByProperty(COLUMN21, column21);
	}
	
	public List findByColumn22(Object column22) {
		return findByProperty(COLUMN22, column22);
	}
	
	public List findByColumn23(Object column23) {
		return findByProperty(COLUMN23, column23);
	}
	
	public List findByColumn27(Object column27) {
		return findByProperty(COLUMN27, column27);
	}
	
	public List findByColumn28(Object column28) {
		return findByProperty(COLUMN28, column28);
	}
	
	public List findByColumn29(Object column29) {
		return findByProperty(COLUMN29, column29);
	}
	
	public List findByColumn30(Object column30) {
		return findByProperty(COLUMN30, column30);
	}
	
	public List findByColumn31(Object column31) {
		return findByProperty(COLUMN31, column31);
	}
	
	public List findByColumn32(Object column32) {
		return findByProperty(COLUMN32, column32);
	}
	
	public List findByColumn33(Object column33) {
		return findByProperty(COLUMN33, column33);
	}
	
	public List findByColumn34(Object column34) {
		return findByProperty(COLUMN34, column34);
	}
	
	public List findByColumn35(Object column35) {
		return findByProperty(COLUMN35, column35);
	}
	
	public List findByColumn36(Object column36) {
		return findByProperty(COLUMN36, column36);
	}
	
	public List findByColumn37(Object column37) {
		return findByProperty(COLUMN37, column37);
	}
	
	public List findByColumn38(Object column38) {
		return findByProperty(COLUMN38, column38);
	}
	
	public List findByColumn39(Object column39) {
		return findByProperty(COLUMN39, column39);
	}
	
	public List findByColumn40(Object column40) {
		return findByProperty(COLUMN40, column40);
	}
	
	public List findByColumn41(Object column41) {
		return findByProperty(COLUMN41, column41);
	}
	
	public List findByColumn42(Object column42) {
		return findByProperty(COLUMN42, column42);
	}
	
	public List findByColumn43(Object column43) {
		return findByProperty(COLUMN43, column43);
	}
	
	public List findByColumn44(Object column44) {
		return findByProperty(COLUMN44, column44);
	}
	
	public List findByColumn45(Object column45) {
		return findByProperty(COLUMN45, column45);
	}
	
	public List findByColumn47(Object column47) {
		return findByProperty(COLUMN47, column47);
	}
	
	public List findByColumn48(Object column48) {
		return findByProperty(COLUMN48, column48);
	}
	
	public List findByColumn49(Object column49) {
		return findByProperty(COLUMN49, column49);
	}
	
	public List findByColumn53(Object column53) {
		return findByProperty(COLUMN53, column53);
	}
	
	public List findByColumn54(Object column54) {
		return findByProperty(COLUMN54, column54);
	}
	
	public List findByColumn55(Object column55) {
		return findByProperty(COLUMN55, column55);
	}
	
	public List findByColumn56(Object column56) {
		return findByProperty(COLUMN56, column56);
	}
	
	public List findByColumn57(Object column57) {
		return findByProperty(COLUMN57, column57);
	}
	
	public List findByColumn58(Object column58) {
		return findByProperty(COLUMN58, column58);
	}
	
	public List findByColumn59(Object column59) {
		return findByProperty(COLUMN59, column59);
	}
	
    public Columntest merge(Columntest detachedInstance) {
        log.debug("merging Columntest instance");
        try {
            Columntest result = (Columntest) getSession()
                    .merge(detachedInstance);
            log.debug("merge successful");
            return result;
        } catch (RuntimeException re) {
            log.error("merge failed", re);
            throw re;
        }
    }

    public void attachDirty(Columntest instance) {
        log.debug("attaching dirty Columntest instance");
        try {
            getSession().saveOrUpdate(instance);
            log.debug("attach successful");
        } catch (RuntimeException re) {
            log.error("attach failed", re);
            throw re;
        }
    }
    
    public void attachClean(Columntest instance) {
        log.debug("attaching clean Columntest instance");
        try {
            getSession().lock(instance, LockMode.NONE);
            log.debug("attach successful");
        } catch (RuntimeException re) {
            log.error("attach failed", re);
            throw re;
        }
    }
}